<?php

namespace App\Http\Controllers\Api;

use App\Http\Resources\StudentResource;
use App\Models\Student;
use App\Http\Controllers;
use Illuminate\Http\Request;

class StudentEnrollController extends Controllers\Controller
{

    public function index(Request $request)
    {
        $school_code = $request->get('keyword');
        $students = Student::query()->where('school_id',$school_code)
            ->where('is_enroll',1)->orderByDesc('id')->paginate();
        return StudentResource::collection($students);
    }

    public function show(){
//        $students = Student::query()->where('school_id',$school_code)
//        ->where('is_enroll',1)->orderByDesc('id')->paginate();
//        dd($students);
//        return StudentResource::collection($students);

    }
}
